package com.example.campusmanagement.controller;

import com.example.campusmanagement.entity.ChargingPile;
import com.example.campusmanagement.entity.LostAndFound;
import com.example.campusmanagement.service.ChargingPileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/charging_pile")
@CrossOrigin(origins = "http://localhost:8081")
public class ChargingPileController {

    @Autowired
    private ChargingPileService chargingPileService;

    @GetMapping("/list")
    public List<ChargingPile> chargeing_piles() {
        List<ChargingPile> chargingPiles = chargingPileService.list();
        return chargingPiles;
    }
}
